package com.kuang.array;


import java.util.Arrays;

public class Demo06 {
    public static void main(String[] args) {
         int[] a = {1,5,3,7,9,2};
        System.out.println(a);
        System.out.println(Arrays.toString(a));
//        printArray(a);
        Arrays.sort(a);
        System.out.println(Arrays.toString(a));
        System.out.println("=====");
        Arrays.fill(a,2,4,0);
        System.out.println(Arrays.toString(a));
    }

    public static void printArray(int[] a){
        for (int i=0;i<a.length;i++){
            if (i==0){
                System.out.print("[");
            }if (i==a.length-1){
                System.out.print(a[i]+"]");
            }else{
                System.out.print(a[i]+",");
            }

        }
    }
}
